package ping.common;

import java.net.InetAddress;
import java.net.SocketAddress;

/**
 * 头部 
 */
public class PacketHeader {
	private SocketAddress socketAddress;
	private InetAddress inetAddress;
	private int port;
	private int offset;
	private int length;
	public PacketHeader(SocketAddress socketAddress, InetAddress inetAddress, int port, int offset, int length) {
		this.socketAddress = socketAddress;
		this.inetAddress = inetAddress;
		this.port = port;
		this.offset = offset;
		this.length = length;
	}
	public SocketAddress getSocketAddress() {
		return socketAddress;
	}
	public void setSocketAddress(SocketAddress socketAddress) {
		this.socketAddress = socketAddress;
	}
	public InetAddress getInetAddress() {
		return inetAddress;
	}
	public void setInetAddress(InetAddress inetAddress) {
		this.inetAddress = inetAddress;
	}
	public int getPort() {
		return port;
	}
	public void setPort(int port) {
		this.port = port;
	}
	public int getOffset() {
		return offset;
	}
	public void setOffset(int offset) {
		this.offset = offset;
	}
	public int getLength() {
		return length;
	}
	public void setLength(int length) {
		this.length = length;
	}
	
	@Override
	public String toString() {
		return "PacketHeader [socketAddress=" + socketAddress + ", inetAddress=" + inetAddress + ", port=" + port
				+ ", offset=" + offset + ", length=" + length + "]";
	}
}
